﻿<phone:PhoneApplicationPage 
    x:Class="EbbinghausWord.Pages.Option"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    Loaded="PhoneApplicationPage_Loaded"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <Style x:Key="normalTextBlock" TargetType="TextBlock">
            <Setter Property="FontSize" Value="28"/>
        </Style>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{StaticResource appTitle}" Style="{StaticResource PhoneTextNormalStyle}"/>

            <TextBlock x:Name="PageTitle" Text="设置" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ScrollViewer VerticalScrollBarVisibility="Visible">
                <StackPanel Orientation="Vertical" VerticalAlignment="Top">
                    <!--显示同义词-->
                    <toolkit:ToggleSwitch x:Name="isShowSynonymToggleSwitch"
                    Header="显示同义词" Content="{Binding ElementName=isShowSynonymToggleSwitch,Path=IsChecked,Converter={StaticResource chineseOffOnConverter}}"
                    IsChecked="{Binding Path=IsShowSynonym,Mode=TwoWay}"/>

                    <!--显示词组-->
                    <toolkit:ToggleSwitch  x:Name="isShowWordGroupToggleSwitch"
                    Header="显示词组" Content="{Binding ElementName=isShowWordGroupToggleSwitch,Path=IsChecked,Converter={StaticResource chineseOffOnConverter}}"
                    IsChecked="{Binding Path=IsShowWordGroup,Mode=TwoWay}"/>

                    <!--显示例句-->
                    <toolkit:ToggleSwitch x:Name="isShowSentenceToggleSwitch"
                    Header="显示例句" Content="{Binding ElementName=isShowSentenceToggleSwitch,Path=IsChecked,Converter={StaticResource chineseOffOnConverter}}"
                    IsChecked="{Binding Path=IsShowSentence,Mode=TwoWay}"/>

                    <!--自动播放发音文件-->
                    <toolkit:ToggleSwitch x:Name="autoPlayVoiceToggleSwitch"
                                          Header="自动发音"
                                          IsChecked="{Binding Path=IsAutoPlayVoice,Mode=TwoWay}"/>

                    <!--下载单词发音文件-->
                    <StackPanel Orientation="Vertical" Margin="0,20,0,0" >
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="下载单词发音：" Style="{StaticResource normalTextBlock}"/>
                            <TextBlock x:Name="voiceCountTextBlock"  Text="1/4000" Style="{StaticResource normalTextBlock}"/>
                        </StackPanel>

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Button x:Name="downloadVoiceButton" Grid.Column="0" Content="开始下载" Click="downloadVoiceButton_Click" />
                        </Grid>
                    </StackPanel>

                    <!--备份操作-->
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="上次备份时间：" Style="{StaticResource normalTextBlock}"/>
                        <TextBlock Text="(无)" Name="backupTextBlock" Style="{StaticResource normalTextBlock}"/>
                    </StackPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>

                        <Button x:Name="backup" Content="备份学习记录" Grid.Column="0" Click="backup_Click"/>
                        <Button x:Name="restore" Content="恢复学习记录" Grid.Column="1" Click="restore_Click"/>
                    </Grid>
                    <Button x:Name="clearCache" Content="清除学习记录" Click="clearCache_Click" />

                    <!--单词排序方式-->
                    <StackPanel Orientation="Vertical" Margin="0,20,0,0" >
                        <TextBlock Text="单词排序方式" Style="{StaticResource normalTextBlock}"/>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Button x:Name="orderButton" Grid.Column="0" Content="顺序排列" Click="orderButton_Click" />
                            <Button x:Name="unorderButton" Grid.Column="1" Content="乱序排列" Click="unorderButton_Click" />
                        </Grid>
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </Grid>
    </Grid>
</phone:PhoneApplicationPage>
